package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.CsOrgFallBack;
import cn.cs.fallback.CsPartsFallBack;
import cn.cs.pojo.CsOrg;
import cn.cs.pojo.CsParts;
import cn.cs.pojo.CsPartsAttribute;
import cn.cs.pojo.CsPartsQrCode;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsOrgFallBack.class)
public interface CsOrgClient {


    @RequestMapping(value = "/getCsOrgById", method = RequestMethod.POST)
    public CsOrg getCsOrgById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getOrgTree", method = RequestMethod.POST)
    public List<CsOrg> getOrgTree() throws Exception;

    @RequestMapping(value = "/getCsOrgListByMap", method = RequestMethod.POST)
    public List<CsOrg> getCsOrgListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCsOrgCountByMap", method = RequestMethod.POST)
    public Integer getCsOrgCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addCsOrg", method = RequestMethod.POST)
    public Integer addCsOrg(@RequestBody CsOrg csOrg) throws Exception;

    @RequestMapping(value = "/modifyCsOrg", method = RequestMethod.POST)
    public Integer modifyCsOrg(@RequestBody CsOrg csOrg) throws Exception;

    @RequestMapping(value = "/deleteCsOrgById", method = RequestMethod.POST)
    public Integer deleteCsOrgById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getMaxCode", method = RequestMethod.POST)
    public Integer getMaxCode(@RequestBody String param)throws Exception;

}

